package com.car.loan.project.xr.util.vo;

import com.car.loan.project.cd.domain.vo.CreditAlbumVo;
import com.car.loan.project.ve.domain.VeVehicleAlbum;
import com.car.loan.project.xr.domain.LoanAlbum;
import com.car.loan.project.xr.util.bo.business.CustomerAddBo;
import com.car.loan.project.xr.util.bo.business.LoanAlbumBo;
import com.google.common.collect.Lists;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;
import java.util.Map;
import javax.validation.constraints.NotNull;
import lombok.Data;

/**
 * @author huangding
 * @description
 * @date 2019/11/14 17:08
 */
@Data
public class LoanDetailVo {

    @ApiModelProperty("基本数据")
    private LoanBaseInfoVo loanBaseInfo;

    @ApiModelProperty(value = "用户信息", required = true)
    private CustomerAddBo customerInfo;

    @ApiModelProperty("业务信息")
    private BusinessInfoVo businessInfo;

    @ApiModelProperty("附件信息,map类型，key等于附件类型")
    private Map<Integer, List<LoanAlbumBo>> loanAlbumMap;

    @ApiModelProperty("征信信息")
    private List<CreditInfo> creditInfos = Lists.newArrayList();

    @ApiModelProperty("车辆评诂信息")
    private List<CarEvaluationInfo> carEvaluations;


    @Data
    public static class CarEvaluationInfo {

        /**
         * 评估编号
         */
        @ApiModelProperty("评估编号")
        private String no;


        /**
         * 车辆品牌
         */
        @ApiModelProperty("车辆品牌")
        private String brand;

        /**
         * 车辆型号
         */
        @ApiModelProperty("车辆型号")
        private String type;

        /**
         * 车架号
         */
        @ApiModelProperty("车架号")
        private String frameNo;

        /**
         * 发动机号
         */
        @ApiModelProperty("发动机号")
        private String engineNo;

        /**
         * 首次登记日期
         */
        @ApiModelProperty("首次登记日期")
        private String firstRegistDate;

        /**
         * 上牌省
         */
        @ApiModelProperty("上牌省")
        private String registProvince;

        /**
         * 上牌市
         */
        @ApiModelProperty("上牌市")
        private String registCity;

        /**
         * 车系型号
         */
        @ApiModelProperty("车系型号")
        private String carSeries;

        /**
         * 业务部门
         */
        @ApiModelProperty("业务部门")
        private String deptName;

        /**
         * 业务员
         */
        @ApiModelProperty("业务员")
        private String adminName;

        /**
         * 评估日期
         */
        @ApiModelProperty("评估日期 ")
        private String evaluationDate;

        /**
         * 评估价
         */
        @ApiModelProperty("评估价")
        private Double evaluationPrice;

        @ApiModelProperty("备注")
        private String remark;

        @ApiModelProperty("评估附件")
        private List<CreditAlbumVo> vehicleAlbums = Lists.newArrayList();


    }

    @Data
    public static class CreditInfo {

        @ApiModelProperty("征信编号")
        private String no;

        @ApiModelProperty("融资银行")
        private String bankName;

        @ApiModelProperty("关系（借款人，配偶，担保人）")
        private String relationship;

        @ApiModelProperty("申请人姓名")
        private String name;

        @ApiModelProperty("客户证件类型 1=身份证 ,当前只有身份证")
        private Integer idType;

        @ApiModelProperty("客户证件号码")
        private String idCardNo;

        @ApiModelProperty(value = "业务部门", required = true)
        private String deptName;

        @ApiModelProperty(value = "业务员id", required = true)
        @NotNull
        private String adminName;

        @ApiModelProperty("征信查询日期")
        private String queryDate;

        @ApiModelProperty("征信明细")
        private String detail;

    }

    @Data
    public static class BusinessInfoVo {

        @ApiModelProperty("车系型号")
        private String carName;

        @ApiModelProperty("融资银行")
        private String bankName;

        @ApiModelProperty(value = "车辆型号")
        private String carType;

        @ApiModelProperty(value = "车辆性质")
        private Integer carNature;

        @ApiModelProperty("车牌类型公牌/私牌")
        private String plateType;

        @ApiModelProperty("上牌省")
        private String registProvince;

        @ApiModelProperty("上牌市")
        private String registCity;

        @ApiModelProperty(value = "车辆型号,和车辆评估一致", required = true)
        private String carModel;

        @ApiModelProperty("发动机号")
        private String engineNo;

        @ApiModelProperty("车架号")
        private String frameNo;

        @ApiModelProperty(value = "分期金额，单位元", required = true)
        private Double installmentAmount;

        @ApiModelProperty(value = "融资金额", required = true)
        private Double financingAmount;

        @ApiModelProperty(value = "合同车价", required = true)
        private Double sellAmount;

        @ApiModelProperty(value = "执行费率，百分比", required = true)
        private Double rate;

        @ApiModelProperty(value = "期数", required = true)
        private Long term;

        @ApiModelProperty(value = "银行费率，百分比", required = true)
        private Double bankRate;

        @ApiModelProperty("业务提交时间")
        private String businessSubmitTime;

        @ApiModelProperty("业务提交人员")
        private String businessSubmitName;

        @ApiModelProperty("业务详情")
        private String remark;

        @ApiModelProperty("合同移交日期")
        private String contractDate;

    }


    @Data
    public static class LoanBaseInfoVo {

        @ApiModelProperty("业务编号")
        private String loanNo;

        @ApiModelProperty("档案编号")
        private String fileNo;

        @ApiModelProperty(value = "业务部门", required = true)
        private String deptName;

        @ApiModelProperty(value = "业务员id", required = true)
        @NotNull
        private String adminName;

        @ApiModelProperty(value = "汽车经销商", required = true)
        @NotNull
        private String dealerName;
    }

}
